<!-- view 视图-->
<template>
	<view>
		<view>Count：{{$store.state.test.count}}</view>
		<view>doubleCount：{{$store.getters['test/doubleCount']}}</view>
		<view style="margin: 10px;">
			<uv-button type="success" text="缓存加一" @click="increment"></uv-button>
		</view>
		<view style="margin: 10px;">
			<uv-button type="success" text="缓存加一（异步）" @click="asyncIncrement"></uv-button>
		</view>
		
	</view>
</template>
<script>
	export default {
		// state 数据源
		data() {
			return {
			}
		},
		computed: {
			// count() {
			// 	return store.state.username
			// }
		},
		// actions 控制状态变化
		methods: {
			increment() {
				this.$store.commit('test/increment')
			},
			/** 异步 */
			asyncIncrement() {
				this.$store.dispatch('test/asyncIncrement')
			}
		}
	}
</script>